
import sys

from fusion.discovery.discover import discover
from fusion.db.sqlite_db import default_start_collection
from fusion.db.db import hex_to_bytes

if len(sys.argv) > 1:
    collection = hex_to_bytes(sys.argv[1])
else:
    collection = default_start_collection

result = discover(collection, maxvals=100)
if result is None:
    print '(Discovery returned None.)'
else:
    for item in result:
        print item['addresses']
